package com.jpmc.refapp.workflow.workitem.handler;

import java.util.HashMap;

import org.drools.runtime.process.WorkItem;
import org.drools.runtime.process.WorkItemHandler;
import org.drools.runtime.process.WorkItemManager;

import com.jpmc.refapp.workflow.domain.Route;

public class WaitStateHandler implements WorkItemHandler{

	private long workItemId;
	@Override
	public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
		System.out.println("Inside WaitStateHandler...");
		HashMap<String, Object> parameterMap =  (HashMap<String, Object>) workItem.getParameters();
		
		Route provRoute = (Route)parameterMap.get("provRoute");
		System.out.println(provRoute.getProvRoute());
		System.out.println("workitem id: "+workItem.getId());
		workItemId=workItem.getId();
		//manager.completeWorkItem(workItem.getId(), parameterMap);
	}

	@Override
	public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
		// TODO Auto-generated method stub
		
	}

	public long getWorkItemId()
	{
		return workItemId;
	}
	
}
